﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="NoteSystem.Index" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
        <!--右半部分-->
       <div class="box_right col-xs-9 ">
       		<%=InitUser() %>
       <!--文章列表-->
       <div class="segment3">
       		<div class="table-responsive" style="padding:0 10px;">
            <table class="table">            
            	<thead>
                 <tr>
                 <th></th>
				<th>作者</th>
				<th>日志标题</th>
				<th>查看次数</th> 
                <th>创建时间</th>  
                <th>操作</th>
 				</tr> </thead>
                
                <tbody>
                    <asp:Repeater ID="rptUserNotes" runat="server" OnItemDataBound="rptUserNotes_ItemDataBound" OnItemCommand="rptUserNotes_ItemCommand">
                        <ItemTemplate>
                           <tr class="mylist">
                           <td>
                               <asp:CheckBox ID="cbxItem" class="checkItem" runat="server" /></td>
				           <td><%#Eval("account") %></td>
				           <td><%#Eval("title") %></td>
                           <td><%#Eval("read_count") %></td>
				           <td><%#Eval("create_time") %></td>
                            <td>
                                <asp:HiddenField ID="hfUserId" runat="server" Value='<%#Eval("user_id") %>' />
                                 <asp:HiddenField ID="hfNoteId" runat="server" Value='<%#Eval("id") %>' />
                                <asp:LinkButton ID="lbtnUpdate" CommandName="Update" runat="server" CommandArgument='<%#Eval("id") %>'>修改</asp:LinkButton>
                               <asp:LinkButton ID="lbtnDelete" runat="server" CommandName="Delete" CommandArgument='<%#Eval("id") %>'>删除</asp:LinkButton>
                                <a href='Show.aspx?id=<%#Eval("id") %>'>查看</a>
                            </td>
			</tr>
                        </ItemTemplate>
                    </asp:Repeater>
            </tbody>         
        </table>
        <div class="clear"></div>
        	<div class="case_page">
            	<div class="page_left">
                    <input type="button" value="全选" onclick="checkAll(true)" />
                    <input type="button" value="全不选" onclick="checkAll(false)"/>
                    <input type="button" value="反选" onclick="checkRevAll()"/>
                	<span class="glyphicon glyphicon-trash"></span>
                    <asp:Button ID="btnDelete" runat="server" Text="删除" OnClick="btnDelete_Click" />
                </div>
                <div class="page_right">
                <ul class="pagination">
                        <li><a href="#">&laquo;</a></li>
                        <li class="active"><a href="#">1</a></li>
                        <li><a href="#">2</a></li>
                        <li><a href="#">3</a></li>
                        <li><a href="#">4</a></li>
                        <li><a href="#">5</a></li>
                        <li><a href="#">&raquo;</a></li>
                    </ul>
                </div>
            </div>
            
            </div>
       </div>
       
     <script type="text/javascript">
         function checkAll(flag) {
             var checkeds = document.getElementsByClassName("checkItem");
             for (var item of checkeds) {
                 item.children[0].checked = flag;
             }
         }
         function checkRevAll() {
             var checkeds = document.getElementsByClassName("checkItem");
             for (var item of checkeds) {
                 item.children[0].checked = !item.children[0].checked;
             }
         }
     </script>  
       
       </div> 
</asp:Content>
   